/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.ipti.br.tag.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import org.ipti.br.tag.util.EncryptionUtil;

/**
 *
 * @author israel
 */
@Entity
public class Season extends AbstractEntity{
    
    @Column(length = 60)
    private String description;

    public Season() {
    }

    @Override
    public void generateHash(){
        if(getId() == null){
            String hash = "" + this.getDescription();
            this.setId(Long.valueOf(EncryptionUtil.encrypt(hash).hashCode()));
        }
    }

    public Season(String description) {
        this.description = description;
    }    
    
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
